def check(text):
    
    while '()' in text or '[]' in text or ' { } ' in text:
        text = text.replace('()', '').replace('[]', '').replace('{}', '').replace(' ', '')
    if len(text) == 0:
        return 'True'
    else: return 'False'



print(check(input()))
